package com.bigShen.mybatis.spring.controller;

import com.bigShen.mybatis.spring.entity.UserInfo;
import com.bigShen.mybatis.spring.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author : lei.shen
 * @date : 2018/12/20
 */
@Controller
@RequestMapping(value = "userInfo")
public class UserInfoController {

    @Autowired
    private UserInfoService userInfoService;

    @ResponseBody
    @RequestMapping("/getUserInfoByName.action")
    public Object getUserInfoByName(String userName) {

        List<UserInfo> userInfos = this.userInfoService.selectUserByName(userName);
        return userInfos;
    }

}
